home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software Vault: The Gold Collection
/
Software Vault - The Gold Collection (American Databankers) (1993).ISO
/
cdr11
/
powerb5.zip
/
P5UTL002.TIP
< prev
next >
Wrap
Text File
|
1993-06-01
|
3KB
|
106 lines
When you delete a DOS file, nothing is actually removed from
the disk. While this gives you the opportunity to unerase
your files, it also means that anyone with the right
software can examine your confidential, "destroyed" data.
Both The Norton Utilities and PC Tools come with utilities
that can erase files beyond all hope of recovery. But if you
don't have one of these collections, you can accomplish the
same thing with my WIPE program.
When you run WIPE, give it the name of your file as a
parameter. Once you've verified that you really want to
delete the file, it's wiped according to U. S. Department of
Defense standard DOD 5220.22M for destroying confidential
data. The file is first overwritten with 0s, then 1s, three
times. It's then overwritten again with a random value. I've
added one step not specified by the DOD: The name of the
file is changed to X prior to deletion. This makes it more
difficult to recover the file with an unerase program. Why?
Because many such programs can't restore more than one
deleted file per directory with a one-character name.
Vincent D. O'Connor
Babbitt, Minnesota
Editor's Note: Mr. O'Connor's original BASIC program
couldn't wipe files larger than 64K. However, it seemed like
such a good idea that I decided to rewrite it in Turbo
Pascal, taking advantage of Pascal's better file handling. A
listing of the program, which I've called VIPER (because it
vipes the file from your hard disk), appears below. A
pre-compiled, ready-to-run version is included as the file
P5UTL\VIPER.EXE on your PowerBase *.* Volume 5 diskette.
To use the program, move it to a directory listed in your
AUTOEXEC.BAT file's PATH command. One warning, though: If
you have a disk cache that has delayed writes, it may
prevent this utility from scrubbing the disk properly. If
you use such a cache, disable it before wiping files.
---- BEGIN LISTING ----
program Viper;
{$I-} {$S-} {$R-}
var
f : file;
pass : Integer;
ch : Char;
procedure Stop;
begin
Writeln('Error wiping file!');
Halt
end;
procedure ErrorCheck;
begin
if IOResult <> 0 then
Stop
end;
procedure WipeWith (var f : file;
c : Char);
var
i : LongInt;
r : Word;
begin
Reset(f,1); ErrorCheck;
for i := 1 to FileSize(f) do
begin
BlockWrite(f,c,1,r);
if r <> 1 then Stop
end;
Close(f); ErrorCheck;
end;
begin {Wipe}
if ParamCount <> 1 then
begin
Writeln('Usage: VIPER <filename>');
Exit
end;
Write('Are you SURE you want to wipe this file (Y/N)? ');
Readln(ch);
if UpCase(ch) <> 'Y' then Halt;
Randomize;
Assign(f,ParamStr(1)); ErrorCheck;
for pass := 1 to 3 do
begin
WipeWith(f,#0);
WipeWith(f,#1)
end;
WipeWith(f,Chr(Random(256)));
Rename(f,'X'); ErrorCheck;
Erase(f); ErrorCheck;
Writeln('Done!')
end.
---- END LISTING ----
Title: Superclean File Wipes
Category: UTL
Issue Date: February, 1992
Editor: Brett Glass
Supplementary Files: P5UTL\VIPER.EXE
Filename: P5UTL002.TIP